package client;

import org.jb2011.lnf.beautyeye.BeautyEyeLNFHelper;
import swing.FrameManager;

import javax.swing.*;

public class Main {

    public static void main(String[] args) {
        //设置整体UI风格
        loadUiStyle();
        //从登录界面启动
        FrameManager.showLoginFrame();
    }

    private static void loadUiStyle() {
//        try {
//            //设置整体UI风格为Nimbus
//            for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
//                if ("Nimbus".equals(info.getName())) {
//                    UIManager.setLookAndFeel(info.getClassName());
//                    break;
//                }
//            }
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
        try {
            //解决切换输入法导致应用白屏的问题
            System.setProperty("sun.java2d.noddraw", "true");
            BeautyEyeLNFHelper.frameBorderStyle = BeautyEyeLNFHelper.FrameBorderStyle.generalNoTranslucencyShadow;
            //使用BeautyEye开源库对整体UI进行美化
            //https://github.com/JackJiang2011/beautyeye
            org.jb2011.lnf.beautyeye.BeautyEyeLNFHelper.launchBeautyEyeLNF();
            UIManager.put("RootPane.setupButtonVisible", false);
            //关闭窗口在不活动时的半透明效果
            BeautyEyeLNFHelper.translucencyAtFrameInactive = false;
        } catch(Exception e) {
            e.printStackTrace();
        }
    }
}
